package ex401.shape;

public class RectangleComponent extends Component {
    private double width;
    private double height;

    public RectangleComponent(Character type, Double width, Double height) {
        super(type);
        this.width = width;
        this.height = height;
    }

    @Override
    public double getArea() {
        return width * height;
    }

    @Override
    public String toString() {
        return "RectangleComponent[" + getType() + "," + width + "," + height + "]";
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }
}
